:root {
  --log-font-family: var(--font-family-monospace);
  --log-font-size: var(--font-size-default);
  --log-color: var(--color-grey-225-10-15);
  --log-border-color: var(--color-grey-225-10-75);
  --log-background-color: var(--color-white);
  --log-resizer-border-color: var(--color-grey-225-10-75);
  --log-button-background-color: var(--color-grey-225-10-95);
  --log-button-border-color: var(--color-grey-225-10-75);
  --log-button-hover-background-color: var(--color-grey-225-10-97);
}

:local(.Log) {

  position: relative;

  display: flex;
  flex-direction: column;
  flex: none;

  z-index: 100;

  .header {
    display: flex;
    justify-content: flex-end;
    padding: 0 5px 0;
  }

  .entries {
    border: none;

    font-size: var(--log-font-size);
    font-family: var(--log-font-family);
    color: var(--log-color);

    white-space: pre-wrap;
    padding: 5px;
    resize: none;
    outline: none;

    width: 100%;
    display: block;

  }

  .entry {
    * {
      user-select: text;
    }
  }

  .resizer {
    width: 100%;
    height: 6px;
    border-top: solid 1px var(--log-resizer-border-color);
    user-select: none;
    cursor: ns-resize;
  }

  &:not(.open) {
    .resizer {
      visibility: hidden;
    }
  }

  .body {
    overflow: auto;
    position: relative;
    border-top: solid 1px var(--log-border-color);
    background: var(--log-background-color);
  }

  button {
    padding: 4px 10px;
    background: var(--log-button-background-color);

    display: inline-block;
    border: solid 1px var(--log-button-border-color);
    border-radius: 2px;
    padding: 3px 8px;
    cursor: default;
    user-select: none;
    outline: none;

    &:hover {
      background: var(--log-button-hover-background-color);
    }
  }

  button + button {
    margin-left: 8px;
  }

  .controls {
    position: sticky;
    top: 5px;
    float: right;

    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease;

    button {
      opacity: .5;

      &:hover,
      &:focus {
        opacity: 1;
      }
    }

  }

  &.open:hover .controls,
  &.open:focus .controls {
    opacity: 1;
    pointer-events: all;
  }

}
